﻿<!DOCTYPE html>
<html>
	<head>
		<title>模块列表</title>
    $css()
	</head>
	<body>
<div class="tabarea1">

    <!--
    <div class="tab_mini">
        <a href="javascript:;" class="current">模块列表</a>
        <a href="?module=module&amp;action=create">创建模块</a>
    </div>
    -->

    <table class="ui-table" id="gd" cellpadding="0" cellspacing="1">
      <tr>
        <th width="40"><span class="th">编号</span></th>
        <th width="100"><span class="th">模块名称</span></th>
        <th width="60"><span class="th">类型</span></th>
        <th><span class="th">栏目视图</span></th>
        <th><span class="th">文档视图</span></th>
        <th width="40"><span class="th">修改</span></th>
        <th width="70"><span class="th">设置属性</span></th>
        <th width="40"><span class="th">删除</span></th>
      </tr>
      ${moduleListHtml}
    </table>
    <div class="ui-table-meta">共${count}个模块</div>

</div>
$js()
<script type="text/javascript">

    var md;
    window.onload = function () {
      j6.table.dynamic(document.getElementsByTagName("table")[0]);

      var bts = j6.$("gd", "button");
      for (var i in bts) {
        switch (bts[i].className) {
          case 'edit': bts[i].onclick = edit; break;
          case 'delete': bts[i].onclick = deleteRecord; break;
          case 'file': bts[i].onclick = setProperties; break;
        }
      }
    };
    function edit() {
       parent.tab.show('编辑模块',location.search.replace('all', 'edit') + '&id=' + getId(this));
     }
    function setProperties() {
      parent.tab.show('设置属性',location.search.replace('all', 'setproperty') + '&id=' + getId(this));
    }
    function deleteRecord() {
      if(confirm('确定删除吗?删除后将不可恢复!')){
        var td = this.parentNode.parentNode;
        var id=getId(this);
        j6.xhr.post('?', "module=module&action=delete&id=" + id,
        function (x) {
            if (x != '') {
               showMsg2(x);
            } else { td.style.display = 'none'; }
        }, function (x) {showMsg2(x);});
      }
     }
    function getId(s) {
      return s.parentNode.parentNode.childNodes[0].innerHTML;
    }
  </script>



	</body>
</html>